package com.tanhua.model.domain;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.*;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Report implements Serializable {
    private String id;
    //评分等级:低级,中级,高级
    @TableField(value = "mock_level")
    private String mockLevel;
    //鉴定结果
    private String conclusion;
    //总分
    @TableField(value = "total_score")
    private Integer totalScore;
    //鉴定图片
    private String cover;
    //维度
    @TableField(value = "dimensions_str")
    private String dimensionsStr;
    //生成报告
    @TableField(value = "user_id")
    private Long userId; //用户id，自己
    private LocalDateTime created; //时间

    //获取维度
    public void mySetDimensionStr(Integer openScore, Integer judgeScore, Integer rationalScore, Integer introvertScore) {
        List<Dimension> dimensions = new ArrayList<>();
        dimensions.add(new Dimension("抽象", openScore + "%"));
        dimensions.add(new Dimension("判断", judgeScore + "%"));
        dimensions.add(new Dimension("理性", rationalScore + "%"));
        dimensions.add(new Dimension("内向", introvertScore + "%"));
        this.dimensionsStr = JSONArray.toJSONString(dimensions);
    }
}

